package com.lrkj.framework.websocket.entity;

import com.lrkj.framework.websocket.model.MessageClient;
import lombok.Data;

import java.io.Serializable;

@Data
public class WSMessage implements Serializable {

    private String key;
    private String title;
    private String message;
    private String client;
    private Integer duration = 2000;
    private Boolean success;

    public WSMessage() {
    }

    public static final WSMessage getPcWSMessage(String key, String msg) {
        WSMessage ms = new WSMessage();
        ms.setClient(MessageClient.PC.name());
        ms.setKey(key);
        ms.setMessage(msg);
        return ms;
    }

    public static final WSMessage getPcWSMessage(String key, String msg, Integer duration) {
        WSMessage ms = new WSMessage();
        ms.setClient(MessageClient.PC.name());
        ms.setDuration(duration);
        ms.setKey(key);
        ms.setMessage(msg);
        return ms;
    }

}
